<%--
  Created by IntelliJ IDEA.
  User: 侯侯
  Date: 2021/12/10
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <c:if test="${param.flag != 0}">
        <%
            Cookie[] cs = request.getCookies();
            request.setAttribute("cs",cs);
        %>
        <c:forEach items="${cs}" var="x">
            <c:if test="${x.name eq 'user'}">
                <c:set value="${x.value}" var="user" scope="request"/>
            </c:if>
            <c:if test="${x.name eq 'pwd'}">
                <c:set value="${x.value}" var="pwd" scope="request"/>
            </c:if>
        </c:forEach>
    </c:if>

    <form action="LoginServlet" method="post">
        <input type="text" name="username" value="${user}">
        <input type="password" name="password" value="${pwd}">
        <input type="submit" value="提交">
    </form>
</body>
</html>
